/*
 * Project: push-center-service-impl
 * 
 * File Created at 2014-10-11
 * 
 * Copyright 2012 Greenline.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Greenline Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Greenline.com.
 */
package com.greenline.push.service.core.tmpl;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * 模板跟外部推送系统app的对应关系
 * 
 * @author weirui.shenwr
 * @date 2014-10-11
 * @version V1.0
 */
public class AppTemplateInfo implements Comparable<AppTemplateInfo> {

    // 对应模板表id
    private Long templateId;
    //
    private Long appTemplateId;
    // 渠道id
    private String appId;
    // 微信 等的模板id
    private String extTemplId;
    private String extTemplType;
    // 推送中心参数和微信等平台参数对应关系a,a2;b,b2
    private String paramConvert;
    // 优先级。规则：保证优先级高的发送，高的发送不成功才发送低优先级的
    private Integer priority;
    // channel
    private Long appChannelId;

    public Long getAppChannelId() {
        return appChannelId;
    }

    public void setAppChannelId(Long appChannelId) {
        this.appChannelId = appChannelId;
    }

    public Long getAppTemplateId() {
        return appTemplateId;
    }

    public void setAppTemplateId(Long appTemplateId) {
        this.appTemplateId = appTemplateId;
    }

    public Long getTemplateId() {
        return templateId;
    }

    public String getExtTemplType() {
        return extTemplType;
    }

    public void setExtTemplType(String extTemplType) {
        this.extTemplType = extTemplType;
    }

    public void setTemplateId(Long templateId) {
        this.templateId = templateId;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public String getExtTemplId() {
        return extTemplId;
    }

    public void setExtTemplId(String extTemplId) {
        this.extTemplId = extTemplId;
    }

    public String getParamConvert() {
        return paramConvert;
    }

    public void setParamConvert(String paramConvert) {
        this.paramConvert = paramConvert;
    }

    public Integer getPriority() {
        return priority;
    }

    public void setPriority(Integer priority) {
        this.priority = priority;
    }

    @Override
    public int compareTo(AppTemplateInfo o) {
        return o.getPriority() - this.priority;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
    }
}
